<template>
	<view>
		<!-- 付款成功弹窗 -->
			<view class="g-success-pop tc">
				<image class="icon-success" src="/static/icon/icon_circle_success.png" mode="aspectFit"></image>
				<block v-if="type == 'course'">
					<view class="fs30 col-3">恭喜您购买成功！</view>
					<view @click="viewVideo()" class="g-btn1">观看课程</view>
				</block>
				<block v-if="type == 'offline'">
					<view class="fs30 col-3">恭喜您报名成功！</view>
				</block>
				<block v-if="type == 'vip'">
					<view class="fs30 col-3">恭喜您VIP购买成功！</view>
				</block>
			</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				type: '',
				order_id: 0,
			}
		},
		onLoad(options) {
			this.type = options.type || '';
			this.order_id = options.order_id || 0;
		},
		onUnload() {
			uni.$emit('buySuccess',[]);
			uni.$emit('orderPay',[]);
		},
		methods: {
			viewVideo(){
				uni.navigateBack({
					delta:1
				})
			}
		}
	}
</script>

<style scoped>

</style>
